package com.my.zidingyikongjian.view.one;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.view.View;

/**
 * 项目名称：圆角矩形
 * 创建人：
 * 创建时间：2018/7/9 16:35
 */

public class ReoundRectView extends View{
    public ReoundRectView(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setStrokeWidth(15); // 画笔宽度
        paint.setStyle(Paint.Style.FILL); // 填充样式
        paint.setColor(Color.RED);

        RectF rectF = new RectF(100,10,300,100);
        canvas.drawRoundRect(rectF,20,10,paint);
    }
}
